/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.systemcar.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author danilo
 */
@Entity
@Table(name = "usuario")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u"),
    @NamedQuery(name = "Usuario.findByUsrId", query = "SELECT u FROM Usuario u WHERE u.usrId = :usrId"),
    @NamedQuery(name = "Usuario.findByUsrNome", query = "SELECT u FROM Usuario u WHERE u.usrNome = :usrNome"),
    @NamedQuery(name = "Usuario.findByUsrSobrenome", query = "SELECT u FROM Usuario u WHERE u.usrSobrenome = :usrSobrenome"),
    @NamedQuery(name = "Usuario.findByUsrEmail", query = "SELECT u FROM Usuario u WHERE u.usrEmail = :usrEmail"),
    @NamedQuery(name = "Usuario.findByUsrSenha", query = "SELECT u FROM Usuario u WHERE u.usrSenha = :usrSenha"),
    @NamedQuery(name = "Usuario.findByUsrDataNascimento", query = "SELECT u FROM Usuario u WHERE u.usrDataNascimento = :usrDataNascimento"),
    @NamedQuery(name = "Usuario.findByUsrSexo", query = "SELECT u FROM Usuario u WHERE u.usrSexo = :usrSexo"),
    @NamedQuery(name = "Usuario.findByUsrHash", query = "SELECT u FROM Usuario u WHERE u.usrHash = :usrHash"),
    @NamedQuery(name = "Usuario.findByUsrIplogin", query = "SELECT u FROM Usuario u WHERE u.usrIplogin = :usrIplogin"),
    @NamedQuery(name = "Usuario.findByUsrDtlogin", query = "SELECT u FROM Usuario u WHERE u.usrDtlogin = :usrDtlogin"),
    @NamedQuery(name = "Usuario.findByUsrDataCadastro", query = "SELECT u FROM Usuario u WHERE u.usrDataCadastro = :usrDataCadastro"),
    @NamedQuery(name = "Usuario.findByUsrStatus", query = "SELECT u FROM Usuario u WHERE u.usrStatus = :usrStatus")})
public class Usuario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "usr_id")
    private Integer usrId;
    @Size(max = 100)
    @Column(name = "usr_nome")
    private String usrNome;
    @Size(max = 100)
    @Column(name = "usr_sobrenome")
    private String usrSobrenome;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "usr_email")
    private String usrEmail;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "usr_senha")
    private String usrSenha;
    @Column(name = "usr_data_nascimento")
    @Temporal(TemporalType.DATE)
    private Date usrDataNascimento;
    @Size(max = 2)
    @Column(name = "usr_sexo")
    private String usrSexo;
    @Lob
    @Size(max = 65535)
    @Column(name = "usr_observacao")
    private String usrObservacao;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "usr_hash")
    private String usrHash;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "usr_iplogin")
    private String usrIplogin;
    @Basic(optional = false)
    @NotNull
    @Column(name = "usr_dtlogin")
    @Temporal(TemporalType.TIMESTAMP)
    private Date usrDtlogin;
    @Basic(optional = false)
    @NotNull
    @Column(name = "usr_data_cadastro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date usrDataCadastro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "usr_status")
    private String usrStatus;

    public Usuario() {
    }

    public Usuario(Integer usrId) {
        this.usrId = usrId;
    }

    public Usuario(Integer usrId, String usrEmail, String usrSenha, String usrHash, String usrIplogin, Date usrDtlogin, Date usrDataCadastro, String usrStatus) {
        this.usrId = usrId;
        this.usrEmail = usrEmail;
        this.usrSenha = usrSenha;
        this.usrHash = usrHash;
        this.usrIplogin = usrIplogin;
        this.usrDtlogin = usrDtlogin;
        this.usrDataCadastro = usrDataCadastro;
        this.usrStatus = usrStatus;
    }

    public Integer getUsrId() {
        return usrId;
    }

    public void setUsrId(Integer usrId) {
        this.usrId = usrId;
    }

    public String getUsrNome() {
        return usrNome;
    }

    public void setUsrNome(String usrNome) {
        this.usrNome = usrNome;
    }

    public String getUsrSobrenome() {
        return usrSobrenome;
    }

    public void setUsrSobrenome(String usrSobrenome) {
        this.usrSobrenome = usrSobrenome;
    }

    public String getUsrEmail() {
        return usrEmail;
    }

    public void setUsrEmail(String usrEmail) {
        this.usrEmail = usrEmail;
    }

    public String getUsrSenha() {
        return usrSenha;
    }

    public void setUsrSenha(String usrSenha) {
        this.usrSenha = usrSenha;
    }

    public Date getUsrDataNascimento() {
        return usrDataNascimento;
    }

    public void setUsrDataNascimento(Date usrDataNascimento) {
        this.usrDataNascimento = usrDataNascimento;
    }

    public String getUsrSexo() {
        return usrSexo;
    }

    public void setUsrSexo(String usrSexo) {
        this.usrSexo = usrSexo;
    }

    public String getUsrObservacao() {
        return usrObservacao;
    }

    public void setUsrObservacao(String usrObservacao) {
        this.usrObservacao = usrObservacao;
    }

    public String getUsrHash() {
        return usrHash;
    }

    public void setUsrHash(String usrHash) {
        this.usrHash = usrHash;
    }

    public String getUsrIplogin() {
        return usrIplogin;
    }

    public void setUsrIplogin(String usrIplogin) {
        this.usrIplogin = usrIplogin;
    }

    public Date getUsrDtlogin() {
        return usrDtlogin;
    }

    public void setUsrDtlogin(Date usrDtlogin) {
        this.usrDtlogin = usrDtlogin;
    }

    public Date getUsrDataCadastro() {
        return usrDataCadastro;
    }

    public void setUsrDataCadastro(Date usrDataCadastro) {
        this.usrDataCadastro = usrDataCadastro;
    }

    public String getUsrStatus() {
        return usrStatus;
    }

    public void setUsrStatus(String usrStatus) {
        this.usrStatus = usrStatus;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (usrId != null ? usrId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usuario)) {
            return false;
        }
        Usuario other = (Usuario) object;
        if ((this.usrId == null && other.usrId != null) || (this.usrId != null && !this.usrId.equals(other.usrId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.systemcar.model.Usuario[ usrId=" + usrId + " ]";
    }
    
}
